import http from "@/common/http/interface";
import {
  mapGetters,
  mapActions
} from 'vuex';
let httpUrl = http.config.baseUrl + 'api/v1/'
export default {
  // 获取手机短信验证码
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8113412050749635
  send: data => {
    return http.request({
      url: httpUrl + "verification/send.verification.sms",
      method: "post",
      data
    });
  },
  // 登陆
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8081625703650847
  login: data => {
    return http.request({
      url: httpUrl + "staff/login.staff.user",
      method: "post",
      data
    });
  },
  // 客服个人信息
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8197110964672049
  getInfo: data => {
    return http.request({
      url: httpUrl + "staff/get.info",
      method: "get",
      data
    });
  },
  // 重置密码
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8197128348751820
  setForgetpwd: data => {
    return http.request({
      url: httpUrl + "staff/set.staff.forgetpwd",
      method: "get",
      data
    });
  },
  // 获取最近联系人
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8234911696263978
  getCallUser: data => {
    return http.request({
      url: httpUrl + "staff/get.call.user",
      method: "get",
      data
    });
  },
  // 获取与某个用户的具体通话记录
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8234914500936370
  getCallLog: data => {
    return http.request({
      url: httpUrl + "staff/get.call.log",
      method: "get",
      data
    });
  },
  // 获取用户活跃的腾讯云IM用户id
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8974893997570808
  getTencentId: data => {
    return http.request({
      url: httpUrl + "user/get.tencent.id",
      method: "get",
      data
    });
  },
  
  // 获取房间id
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8754496230586048
  getRoomId: data => {
    return http.request({
      url: httpUrl + "chat/get.roomid",
      method: "get",
      data
    });
  },
  // 发起通话
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8754496983836083
  startCalling: data => {
    return http.request({
      url: httpUrl + "chat/start.calling",
      method: "post",
      data
    });
  },
  // 客服开始通话
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8234911696263978
  startService: data => {
    return http.request({
      url: httpUrl + "staff/start.service",
      method: "post",
      data
    });
  },
  // 客服结束通话
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8234914500936370
  stopService: data => {
    return http.request({
      url: httpUrl + "staff/stop.service",
      method: "post",
      data
    });
  },
  // 客服拒绝接听
  // 文档地址：https://www.showdoc.com.cn/799517136031066/8368603225751755
  rejectService: data => {
    return http.request({
      url: httpUrl + "staff/reject.service",
      method: "post",
      data
    });
  },
}
